package com.itheima.service.db.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.itheima.domain.db.Admin;
import com.itheima.mapper.AdminMapper;
import com.itheima.service.db.AdminService;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;

@DubboService
public class AdminServiceImpl implements AdminService {

    @Autowired
    AdminMapper adminMapper;

    @Override
    public Admin findByUsername(String username) {
        //1.创建querywraper对象
        QueryWrapper<Admin> wrapper = new QueryWrapper<>();

        //2.设置用户名条件
        wrapper.eq("username", username);

        //3.查询用户且返回
        return adminMapper.selectOne(wrapper);
    }
}